package cn.duwey.scs.common.support;

import cn.duwey.scs.common.dto.ServiceResult;
import cn.duwey.scs.common.constants.RpcConstants;

public class RpcSupport {

    public static <T> ServiceResult<T> wrapSuccess(T data) {
        return new ServiceResult<>(RpcConstants.CODE_SUCCESS, RpcConstants.MSG_SUCCESS, data);
    }

    public static <T> ServiceResult<T> wrapFailed(int errorCode, String errorMsg, T data) {
        return new ServiceResult<>(errorCode, errorMsg, data);
    }

}
